package com.itheima.内部类.匿名内部类;

public class Demo {
    public static void main(String[] args) {

        Swim swim=new Swim(){
            public void swimming(){
                System.out.println("狗狗会狗刨");
            }
        };

        swim.swimming();
        swim.swimming();
//需求：创建Cat类的对象并调用其eat方法
        Cat c=new Cat();
        c.eat();
        //匿名对象：只能用一次
        new Cat().eat();



    }

}
